<%@ page import="java.util.List" %>
<%@ page import="top.wuyang.study.javawebjdbc.workcp.TbCp" %>
<%@ page import="top.wuyang.study.javawebjdbc.workcp.TbCpDAO" %><%--
  Created by IntelliJ IDEA.
  User: lenovo
  Date: 2024/6/3
  Time: 10:44
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>页面</title>
    <link href="../../lib/bootstarp.min.css" rel="stylesheet">
</head>
<body>

<h2>
    <a href="../../index.jsp">返回目录</a>
</h2>

<%
    List<TbCp> list = TbCpDAO.query();
%>

<div>
    <div style="display: flex;justify-content: space-around">
        <div><h2>计算机信息表</h2></div>
        <div>
            <a href="insert.jsp" class="btn btn-success">添加</a>
        </div>
    </div>

    <table class="table table-hover table-striped table-bordered">
      <thead>
      <tr class="text-bg-success">
          <th>编号</th>
          <th>厂商</th>
          <th>电脑简介</th>
          <th>电脑价格</th>
          <th>操作</th>
      </tr>
      </thead>
        <tbody>
        <%
            for (TbCp tbCp : list){
        %>
        <tr>
            <td><%=tbCp.getId()%></td>
            <td><%=tbCp.getChangshang()%></td>
            <td><%=tbCp.getDnjj()%></td>
            <td><%=tbCp.getPrice()%></td>
            <td>
                <a href="delete.jsp?id=<%=tbCp.getId()%>" class="btn btn-sm btn-danger">删除</a>
            </td>
        </tr>
        <% } %>
        </tbody>
    </table>
</div>





</body>
</html>
